<script type="text/html" template
        lay-url="{{ window.globalConfig.url_download + '/' + layui.router().search.down_id }}"
        lay-done="layui.data.done(d);">
    <title>附件详情</title>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <a href="javascript:history.back()"
                           class="layui-btn layui-btn-primary layui-btn-sm" id="goBack">返回上级</a>
                        {{ d.data.title }}
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-form" lay-filter="LAY-home-download-listform"
                             id="LAY-home-download-listform"
                             style="padding: 20px 30px 0 0;">
                            <div class="layui-form-item">
                                <label class="layui-form-label">小标题</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="title" value="{{ d.data.title || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入小标题" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">附件名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="keywords" value="{{ d.data.keywords || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入附件名称" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

                            <!-- 附件类型 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">附件类型</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="catName" value=""
                                           class="layui-input" readonly/>
                                    <input type="hidden" id="catId" name="cat_id"
                                           value="{{ d.data.cat_id }}"
                                           class="layui-input"/>

                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">附件文件</label>
                                <div class="layui-input-inline">

                                    <div class="layui-input-group">
                                        <input type="text" readonly name="url" id="downloadUrl"
                                               class="layui-input"
                                               lay-verify="required"
                                               value="{{ d.data.url }}" style="width: 190px;">
                                        <div class="layui-input-suffix">
                                            <button class="layui-btn layui-btn-primary" id="ID-upload-download-btn">
                                                上传
                                            </button>
                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">是否启用</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="is_enable" title="启用|关闭" value="1"
                                           lay-skin="switch"
                                           {{# if(d.data.is_enable){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">是否置顶</label>
                                <div class="layui-input-inline">
                                    <input type="checkbox" name="is_top" title="是|否" value="1" lay-skin="switch"
                                           {{# if(d.data.is_top){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline">
                                    <input type="number" name="orderid" lay-affix="number" min="0"
                                           value="{{ d.data.orderid | 0 }}"
                                           lay-verify="required|number" placeholder="请输入排序" autocomplete="off"
                                           class="layui-input">
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">附件描述</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="des" value="{{ d.data.des || '' }}"
                                           placeholder="请输入附件描述" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>


                            <input type="hidden" name="down_id" value="{{ d.data.down_id }}">
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-inline">
                                    <input type="button" lay-submit
                                           lay-filter="LAY-home-download-listform-submit"
                                           value="保存"
                                           class="layui-btn">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="res/modules/download.js"></script>
